package edu.hpu.mybatis.controller;

import edu.hpu.mybatis.mapper.CategoryMapper;
import edu.hpu.mybatis.pojo.Category;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class SelectController {

    @Autowired
    //从容器中找一个对象赋值给categoryMapper
    CategoryMapper categoryMapper;

    @RequestMapping("/select")
    public List<Category> select(){
        return categoryMapper.selectAll();
    }
}
